<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<label id="label1"></label>
		
	</body>
	<script type="text/javascript">
		function testPost1(){
				var ajax = new XMLHttpRequest();
						ajax.open('POST','https://api.apiopen.top/searchPoetry');
						ajax.send('name=古风二首 二');			
						ajax.onreadystatechange = function(){
							if(ajax.status == 200 && ajax.readyState==4){
								var obj= ajax.responseText;
		  var labeltext1=document.getElementById('label1');
						 labeltext1.innerHTML=obj;
			}
			}
			
		}
	function testPost2(){
			var ajax = new XMLHttpRequest();
					ajax.open('POST','https://www.apiopen.top/weatherApi');
					ajax.send('city=成都');			
					ajax.onreadystatechange = function(){
						if(ajax.status == 200 && ajax.readyState==4){
							var obj= ajax.responseText;
	  var labeltext1=document.getElementById('label1');
					 labeltext1.innerHTML=obj;
		}
		}
		
	}
	function testPost3(){
			var ajax = new XMLHttpRequest();
					ajax.open('POST','https://api.apiopen.top/getTangPoetry');
					ajax.send('page=1&count=5');			
					ajax.onreadystatechange = function(){
						if(ajax.status == 200 && ajax.readyState==4){
							var obj= ajax.responseText;
	  var labeltext1=document.getElementById('label1');
					 labeltext1.innerHTML=obj;
		}
		}
		
	}
	function testPost4(){
			var ajax = new XMLHttpRequest();
					ajax.open('POST','https://api.apiopen.top/registerUser');
					ajax.send('apikey=d0058f79caae5300dcba65f128e52855&name=peakchao&passwd=123456');			
					ajax.onreadystatechange = function(){
						if(ajax.status == 200 && ajax.readyState==4){
							var obj= ajax.responseText;
	  var labeltext1=document.getElementById('label1');
					 labeltext1.innerHTML=obj;
		}
		}
		
	}
	function testPost5(){
			var ajax = new XMLHttpRequest();
					ajax.open('POST','https://api.apiopen.top/updateUserInfo');
					ajax.send('apikey=d0058f79caae5300dcba65f128e52855&name=peakchao&passwd=123456');			
					ajax.onreadystatechange = function(){
						if(ajax.status == 200 && ajax.readyState==4){
							var obj= ajax.responseText;
	  var labeltext1=document.getElementById('label1');
					 labeltext1.innerHTML=obj;
		}
		}
		
	}
		onload=function(){
			//testPost1();
			//testPost2();
			//testPost3();
			//testPost4();
			testPost5();
			
		}
	</script>
</html>